<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<canvas width="200" height="200" id="mycanvas"></canvas>

<body>
  <script>
    var mycanvas = document.getElementById('mycanvas');
    var context = mycanvas.getContext("2d");
    context.fillStyle = '#f00';
    // context.rotate(45);
    context.fillRect(0, 0, 200, 200);
  </script>
</body>

</html>